from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from info import create_app, db
from info import models


# 使用工厂模式返回App对象，和db对象
app = create_app("Development")
# 把App对象和db对象交给manager管理
manager = Manager(app, db)
# 为数据库迁移做准备
Migrate(app, db)
manager.add_command("xxxx", MigrateCommand)


if __name__ == '__main__':
    manager.run()
